package reflect;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * java就近调用原则
 * 传入null时，java匹配类型采取的原则是先找子类，再找超类，接口最后是Object
 */
public class Test05 {
    public static void main(String[] args){
        dosome(null);
    }
    public static void dosome(Object o){
        System.out.println("dosome(Object o)");
    }
    public static void dosome(Collection o){
        System.out.println("dosome(Collection c)");
    }
    public static void dosome(List o){
        System.out.println("dosome(List list)");
    }
    public static void dosome(ArrayList o){
        System.out.println("dosome(ArrayList arrayList)");
    }
    public static void dosome(int o){
        System.out.println("dosome(int i)");
    }
    public static void dosome(double o){
        System.out.println("dosome(double i)");
    }
}
